import React, { Component } from 'react';
import { Tabs } from 'antd-mobile';
import YwxNavBar from '../../components/common/YwxNavBar/YwxNavBar';

import StatusList from '../../components/Status/StatusList/StatusList';
import './Status.less'
const tabs = [
    { title: <div>申请记录</div> },
    { title: <div>申请通过</div> },
    { title: <div>待激活</div> }
];


export default class Status extends Component {


    constructor(props) {
        super(props);
        this.state = {
            type: 0
        }
    }

    onTabChange = (index) => {
        this.setState({ type: index });
    }

    render() {

        return (
            <div className='status'>
                <YwxNavBar>推广状态</YwxNavBar>
                <Tabs tabs={tabs}
                    page={this.state.type}
                    swipeable={false}
                    onChange={(tab, index) => { this.onTabChange(index) }}
                    onTabClick={(tab, index) => { console.log('onTabClick', index, tab); }}
                >
                    <StatusList type={0} />
                    <StatusList type={1} />
                    <StatusList type={2} />
                </Tabs>
            </div>
        );
    }
}